<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTradingAddressTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        if (!Schema::hasTable('trading_addresses')) {
            Schema::create('trading_addresses', function (Blueprint $table) {
                $table->increments('id');
                $table->unsignedInteger('user_id')->comment('用户ID');
                $table->unsignedInteger('coin_id')->comment('币种ID');
                $table->string('address')->comment('提现地址');
                $table->string('note')->comment('地址备注');
                $table->string('tag')->nullable()->comment('标签');
                $table->unsignedTinyInteger('is_usdt_erc20')->nullable()->default(0)->comment('是否为USDT的ERC20提币地址:0-不是 1-是');
            });
        }
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('trading_addresses');
    }
}
